<?php


namespace app\common\validate;


use think\Validate;

class EnterPriseCheck extends Validate
{
  /**
   * 验证规则
   */
  protected $rule = [
    'company_name'     => 'require',
    'name'    => 'require',
    'identity'    => 'require',
    'identity_reverse'    => 'require',
    'identity_positive'    => 'require',
    'license'    => 'require',
    'credit_code'  => 'require'
  ];

  /**
   * 字段描述
   */
  protected $field = [];

  /**
   * 提示消息
   */
  protected $message = [
    'company_name.require'     => '公司名称不能为空',
    'identity_positive.require'    => '身份证正面不能为空',
    'identity_reverse.require' => '身份证反面不能为空',
    'name.require'  => '法人姓名不能为空',
    'license.require'    => '营业执照不能为空',
    'credit_code.require'      => '社会信用代码不能为空',
  ];

  /**
   * 验证场景
   */
  protected $scene = [];

  public function __construct(array $rules = [], $message = [], $field = [])
  {
    $this->field = [
      'company_name'     => __('公司名称'),
      'license'    => __('营业执照'),
      'identity_positive' => __('身份证正面'),
      'identity_reverse'    => __('身份证反面'),
      'identity'    => __('身份证号'),
      'credit_code'  => __('社会信用代码')
    ];
    parent::__construct($rules, $message, $field);
  }
}